<template>
    <div class="detail">
    <div class="pay">
      <h2 class="myp">应付金额:<i class="myi">{{totalprice}}</i></h2>
      <p><strong>订单编号:</strong>{{orderId}}</p>
      <div class="blank"></div>
      <el-button type="primary" @click="$router.go(-1)">取消</el-button>
      <el-button type="primary" @click="pay">立即支付</el-button>
    </div>
</div>
  </template>
<script>

export default {
    name: 'PayView',
    data(){
        return {
            totalprice:0,
            orderId:''
        }
    },
    created(){
         this.totalprice=this.$route.query.data
         this.orderId=this.$route.query.orderId
    },
    methods:{
        pay(){
            let id=this.orderId
            this.axios.put('api/editOrder',{params:{orderId:id}})
            .then(res=>{
                this.$message('支付成功')
                this.$router.push("/goods");
            })
        }
    }
}
</script>
  <style>
.myi{
    color: #f00;
}
.myp{
    margin: 20px;
}
.blank{
    height: 20px;
}
.pay{
    border: 1px solid #ccc;
    width: 400px;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.85);
    margin-top: 30px;
}
.detail{
    background: url(../../public/22.png)no-repeat;
    height: 100vh;
    border-top: 1px solid transparent;
}
</style>